package com.runen.infinitemovement.adapter;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.runen.infinitemovement.R;
import com.runen.infinitemovement.model.entity.HitCardAdapterEntity;
import com.runen.infinitemovement.tool.GlideUtils;

/**
 * Create by LiaoDuanHong
 * Create on
 */
public class HitCardAdapter extends BaseQuickAdapter<HitCardAdapterEntity, BaseViewHolder> {
    private Context context;

    public HitCardAdapter(Context context) {
        super(R.layout.item_hit_card);
        this.context = context;
    }

    @Override
    protected void convert(BaseViewHolder baseViewHolder, HitCardAdapterEntity s) {
        ImageView iv_content = baseViewHolder.findView(R.id.iv_content);
        GlideUtils.loadImage(context, s.url, iv_content);
        View v_content = baseViewHolder.findView(R.id.v_content);
        ImageView iv_check = baseViewHolder.findView(R.id.iv_check);
        if (s.isSelect) {
            iv_check.setVisibility(View.VISIBLE);
            v_content.setVisibility(View.VISIBLE);
        } else {
            iv_check.setVisibility(View.GONE);
            v_content.setVisibility(View.GONE);
        }
    }
}
